<template>
<div class="bg-red">
    {{ myPopupRef.className }}
    <a-button @click="getLine(1)">getLine</a-button>
    <a-button @click="close">close</a-button>
</div>
</template>

<script>
import {inject} from "vue";

export default {
    props: {
        getLines: {
            type: Function
        },
        closePop: {
            type: Function
        }
    },
    setup(props) {
        // 接收参数
        const myPopupRef = inject('myPopupRef')
        // 调用父组件方法
        const getLine = (data) => {
            props.getLines(data)
        }

        // close
        const close = () => {
            // myPopupRef.remove()
            props.closePop()
        }

        return {
            myPopupRef, getLine, close
        }
    }
}
</script>

<style lang="scss" scoped>

</style>
